#!/bin/bash

# 接收解压路径参数
extract_path=$1
kvaser_path="$extract_path/socketcan_kvaser_drivers"

echo "===Install kvaser driver start==="
echo "cd driver path: $kvaser_path"
cd "$kvaser_path" || exit 255
sudo make uninstall KV_MODULE_NAME=kvaser_pciefd
sudo make KV_MODULE_NAME=kvaser_pciefd
sudo make install KV_MODULE_NAME=kvaser_pciefd
sudo make load KV_MODULE_NAME=kvaser_pciefd
rm -fr "$extract_path"
echo "Please exec 'lsmod | grep kvas' check"
echo "===Install kvaser driver end==="
